//
//  NSString+RandomNumber.m
//  RentTable
//
//  Created by mac on 2024/11/30.
//

#import "NSString+RandomNumber.h"

@implementation NSString (RandomNumber)

+ (NSString *)randomNumberStringWithLength:(NSUInteger)length {
    NSMutableString *randomString = [NSMutableString stringWithCapacity:length];
    for (NSUInteger i = 0; i < length; i++) {
        // 随机生成0-9之间的数字
        NSInteger randomDigit = arc4random_uniform(10);
        [randomString appendFormat:@"%ld", (long)randomDigit];
    }
    return [randomString copy];
}

@end

